package com.HospitalOutpatient.dao;

import com.HospitalOutpatient.entity.Medication;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MedicationDao {

    @Select("select * from medication")
    List<Medication> selectAllMedication();

    @Insert("insert into medication values (null,#{medicationName},#{charge})")
    int insertMedication(Medication medication);

    @Delete("delete from medication where medicationId = #{medicationId}")
    int deleteMedication(String medicationId);

    List<Medication> selectMedicationByName(String medicationName);

    @Select("select * from medication where medicationId = #{medicationId}")
    Medication selectMedicationById(String medicationId);
}
